cmake_minimum_required(VERSION 3.22.1)
project(MoreBlocks)
file(GLOB_RECURSE SRCS "./src/**")
add_library(${PROJECT_NAME} SHARED ${SRCS})
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_DLL)
target_include_directories(${PROJECT_NAME} PUBLIC
    src
)
target_link_libraries(${PROJECT_NAME} PUBLIC
    MyGLCraft-Core
)

set(APP_DIR ../../../build/${CMAKE_BUILD_TYPE})
set(PLUGINS_DIR ${APP_DIR}/plugins)
message(${APP_DIR}/plugins)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${PROJECT_NAME}> ${PLUGINS_DIR}/$<TARGET_FILE_NAME:${PROJECT_NAME}>
)
